package org.millioncall.yueyoga.admin.dao;

import java.util.List;
import java.util.Map;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.model.Authority;

public interface AuthorityDAO {
	
	/**
	 * 保存
	 * @param authority
	 * @return
	 */
	public int saveAuthority(Authority authority);
	
	/**
	 * 删除
	 * @param ids
	 * @return
	 */
	public int deleteAuthorities(List<Integer> ids);
	
	void save(Authority authority);
	
	public void delete(Authority authority);

	public Authority findById(int id);

	public List<Authority> findByProperty(String propertyName, Object value);

	public List<Authority> findByName(String name);

	public List<Authority> findByEnabled(Boolean enabled);

	public List<Authority> findAll();

	public List<Authority> findAuthoritiesByRoleId(int roleId);

	public PaginatedList<Authority> findAllAuthorities(int start, int limit,
			Map<String, String> map);
	
	public int saveAuthoritySource(Map<String,String> map);
	
	public int deleteAuthorityResource(int auId);
	
	public Authority findAuthorityByName(String name);

}